home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / COMPILER / SATHER / !Sather / Library / Containrs / sa / dispenser < prev    next >
Text File  |  1996-04-09  |  2KB  |  38 lines

  1. ---------------------------> Sather 1.1 source file <--------------------------
  2. -- dispenser.sa: Dispenser abstraction
  3. -- Author: Benedict A. Gomes <gomes@samosa.ICSI.Berkeley.EDU>
  4. -- Copyright (C) 1995, International Computer Science Institute
  5. -- $Id: dispenser.sa,v 1.2 1996/04/09 10:04:50 borisv Exp $
  6. --
  7. -- COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
  8. -- and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
  9. -- LICENSE contained in the file: Sather/Doc/License of the
  10. -- Sather distribution. The license is also available from ICSI,
  11. -- 1947 Center St., Suite 600, Berkeley CA 94704, USA.
  12. -------------------------------------------------------------------
  13.  
  14. abstract class $DISPENSER{ETP} < $CONTAINER{ETP},$STR is
  15.    -- A dispenser is an abstraction that only permits the removal
  16.    -- of one element at a time.
  17.    -- This abstraction just permits the non-modifying operations
  18.    -- and is mainly to organize the collection of classes (to ensure
  19.    -- that they all have certain basic features like size).
  20.    -- We do not currently believe that an abstract dispenser will show
  21.    -- up in actual code...
  22.    
  23.    size: INT;
  24.    -- Number of items in the dispenser
  25.    
  26.    current: ETP;
  27.    -- Return the current item
  28.    
  29.    remove: ETP;        
  30.    -- Return the current item and advance 
  31.    
  32.    elt!: ETP;
  33.    -- Return the elements of the dispenser in some *undefined* order.
  34.    -- Particular abstractions might define a stronger ordering relation
  35.    
  36. end;
  37. -------------------------------------------------------------------
  38.